package lab04.test01;

/**
 * 用 Runnable 方式来解决
 */
public class HelloWorldTread2 implements Runnable {
    @Override
    public void run() {
        //每隔一秒向控制台输出"Hello,World!"
        while(true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("Hello,World!");
        }
     }
}
